package org.example.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ReportMapper {
    
    @Insert("UPDATE user SET reporter = #{report} WHERE id = #{userId}")
    void saveReport(String report, Long userId);
    
    @Select("SELECT reporter FROM user WHERE id = #{userId}")
    String getLatestReport();
    
    @Select("SELECT reporter FROM user WHERE id = #{userId} AND reporter IS NOT NULL")
    String getReportByUserId(Long userId);
} 